package com.wx.mythread.thread;

/**
 * 消失的数字
 */
public class SafeThread implements Runnable {
    private static int i = 0;
    @Override
    public void run() {
        for (int j = 0; j < 100000; j++) {
            i++;
        }
    }
    public static void main(String[] args) throws InterruptedException {
        SafeThread thread1 = new SafeThread();
        SafeThread thread2 = new SafeThread();
        Thread thread3 = new Thread(thread1);
        Thread thread4 = new Thread(thread2);
        thread3.start();
        thread4.start();
        thread3.join();
        thread4.join();
        System.out.println(i);
    }
}
